<%@ page import="java.sql.*" %>
<%! String cid="",pass="";Connection con; %>
<% 
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:dsn1","system","pintu");
Statement stmt=con.createStatement();
ResultSet rs;
cid=request.getParameter("uid");
pass=request.getParameter("cpass");
//System.out.println("cid="+cid+" pass="+pass);
rs=stmt.executeQuery("select * from login where userid='"+cid+"' and password='"+pass+"' ");
if(rs.next())
{
session.setAttribute("scid",cid);
con.close(); 
response.sendRedirect("myPage.jsp");
}
else
{
%>
<html>
<link href="./login.css" rel="stylesheet" type="text/css" />
<body>
<h1>Exists username!</h1>
<jsp:include page="register.jsp" />
<%
}
%>
</body>
</html>